function newpl = polyval(pl, newVal)

//calculate value of polynomial of pl, with element's value newVal.
s=poly(0,'s');

plNumCoef = coeff(numer(pl));
plDenCoef = coeff(denom(pl));
plNum = 0;
plDen = 0;
for i=1:length(plNumCoef)
  plNum = plNum + plNumCoef(i)*newVal^(i-1);
end
for i = 1:length(plDenCoef)
  plDen = plDen + plDenCoef(i)*newVal^(i-1);
end
newpl = plNum/plDen;

endfunction
